package com.happystudy.serviceImpl;

import com.happpystudy.model.course.CourseKey;
import com.happpystudy.model.grade.CourseFile;
import com.happpystudy.service.CourseFileService;
import com.happystudy.mapper.CourseFileMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class CourseFileServiceImpl implements CourseFileService {

    @Resource
    CourseFileMapper courseFileMapper;

    @Override
    public int insertCourseFile(CourseFile file){
        return courseFileMapper.insertSelective(file);
    }

    @Override
    public List<CourseFile> selectAllCourseFilesByCourseKey(CourseKey courseKey) {

        return courseFileMapper.selectAllFileByCourseKey(courseKey);
    }

    @Override
    public int deleteCourseFile(String fullPath) {
        return courseFileMapper.deleteByUuid(fullPath);

    }
}
